<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the getContact method from the FlutterContacts class, for the Dart programming language.">
  <title>getContact method - FlutterContacts class - flutter_contacts library - Dart API</title>


  
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" rel="stylesheet">
  
  <link rel="stylesheet" href="../../static-assets/github.css?v1">
  <link rel="stylesheet" href="../../static-assets/styles.css?v1">
  <link rel="icon" href="../../static-assets/favicon.png?v1">

  
</head>


<body data-base-href="../../" data-using-base-href="false" class="light-theme">

<div id="overlay-under-drawer"></div>

<header id="title">
  <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="../../index.html">flutter_contacts</a></li>
    <li><a href="../../flutter_contacts/flutter_contacts-library.html">flutter_contacts</a></li>
    <li><a href="../../flutter_contacts/FlutterContacts-class.html">FlutterContacts</a></li>
    <li class="self-crumb">getContact static method</li>
  </ol>
  <div class="self-name">getContact</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
  <div class="toggle" id="theme-button">
    <label for="theme">
      <input type="checkbox" id="theme" value="light-theme">
      <span id="dark-theme-button" class="material-symbols-outlined">
        brightness_4
      </span>
      <span id="light-theme-button" class="material-symbols-outlined">
        brightness_5
      </span>
    </label>
  </div>
</header>
<main>

  <div id="dartdoc-main-content" class="main-content">
      <div>
<h1><span class="kind-method">getContact</span> static method 
</h1></div>

    <section class="multi-line-signature">
      

<span class="returntype"><a href="https://api.flutter.dev/flutter/dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../../contact/Contact-class.html">Contact</a>?</span>&gt;</span></span>
<span class="name ">getContact</span>(<wbr><ol class="parameter-list"><li><span class="parameter" id="getContact-param-id"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">id</span>, </span></li>
<li><span class="parameter" id="getContact-param-withProperties">{<span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">withProperties</span> = <span class="default-value">true</span>, </span></li>
<li><span class="parameter" id="getContact-param-withThumbnail"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">withThumbnail</span> = <span class="default-value">true</span>, </span></li>
<li><span class="parameter" id="getContact-param-withPhoto"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">withPhoto</span> = <span class="default-value">true</span>, </span></li>
<li><span class="parameter" id="getContact-param-withGroups"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">withGroups</span> = <span class="default-value">false</span>, </span></li>
<li><span class="parameter" id="getContact-param-withAccounts"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">withAccounts</span> = <span class="default-value">false</span>, </span></li>
<li><span class="parameter" id="getContact-param-deduplicateProperties"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">deduplicateProperties</span> = <span class="default-value">true</span>}</span></li>
</ol>)

      

    </section>
    
<section class="desc markdown">
  <p>Fetches one contact.</p>
<p>By default everything available is fetched. If <code>withProperties</code> is
false, properties (phones, emails, addresses, websites, etc) won't be
fetched.</p>
<p>If <code>withThumbnail</code> is false, the low-resolution thumbnail won't be
fetched. If <code>withPhoto</code> is false, the high-resolution photo won't be
fetched.</p>
<p>If <code>withGroups</code> is true, it also returns the group information (called
labels on Android and groups on iOS).</p>
<p>If <code>withAccounts</code> is true, it also returns the account information. On
Android this is the raw account, and there can be several accounts per
unified contact (for example one for Gmail, one for Skype and one for
WhatsApp). On iOS it is called container, and there can be only one
container per contact.</p>
<p>If <code>deduplicateProperties</code> is true, the properties will be de-duplicated,
mainly to avoid the case (common on Android) where multiple equivalent
phones are returned.</p>
</section>


    
<section class="summary source-code" id="source">
  <h2><span>Implementation</span></h2>
  <pre class="language-dart"><code class="language-dart">static Future&lt;Contact?&gt; getContact(
  String id, {
  bool withProperties = true,
  bool withThumbnail = true,
  bool withPhoto = true,
  bool withGroups = false,
  bool withAccounts = false,
  bool deduplicateProperties = true,
}) async {
  final contacts = await _select(
    id: id,
    withProperties: withProperties,
    withThumbnail: withThumbnail,
    withPhoto: withPhoto,
    withGroups: withGroups,
    withAccounts: withAccounts,
    sorted: false,
    deduplicateProperties: deduplicateProperties,
  );
  if (contacts.length != 1) return null;
  return contacts.first;
}</code></pre>
</section>


  </div> <!-- /.main-content -->

  <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
    <header id="header-search-sidebar" class="hidden-l">
  <form class="search-sidebar" role="search">
    <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
  <li><a href="../../index.html">flutter_contacts</a></li>
  <li><a href="../../flutter_contacts/flutter_contacts-library.html">flutter_contacts</a></li>
  <li><a href="../../flutter_contacts/FlutterContacts-class.html">FlutterContacts</a></li>
  <li class="self-crumb">getContact static method</li>
</ol>


    <h5>FlutterContacts class</h5>
    <ol>

        <li class="section-title"><a href="../../flutter_contacts/FlutterContacts-class.html#constructors">Constructors</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/FlutterContacts.html">FlutterContacts</a></li>


        <li class="section-title inherited">
          <a href="../../flutter_contacts/FlutterContacts-class.html#instance-properties">Properties</a>
        </li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/hashCode.html">hashCode</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html">runtimeType</a></li>

        <li class="section-title inherited"><a href="../../flutter_contacts/FlutterContacts-class.html#instance-methods">Methods</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/toString.html">toString</a></li>

        <li class="section-title inherited"><a href="../../flutter_contacts/FlutterContacts-class.html#operators">Operators</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html">operator ==</a></li>


        <li class="section-title"><a href="../../flutter_contacts/FlutterContacts-class.html#static-properties">Static properties</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/config.html">config</a></li>

        <li class="section-title"><a href="../../flutter_contacts/FlutterContacts-class.html#static-methods">Static methods</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/addListener.html">addListener</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/deleteContact.html">deleteContact</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/deleteContacts.html">deleteContacts</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/deleteGroup.html">deleteGroup</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/getContact.html">getContact</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/getContacts.html">getContacts</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/getGroups.html">getGroups</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/insertContact.html">insertContact</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/insertGroup.html">insertGroup</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/openExternalEdit.html">openExternalEdit</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/openExternalInsert.html">openExternalInsert</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/openExternalPick.html">openExternalPick</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/openExternalView.html">openExternalView</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/removeListener.html">removeListener</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/requestPermission.html">requestPermission</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/updateContact.html">updateContact</a></li>
          <li><a href="../../flutter_contacts/FlutterContacts/updateGroup.html">updateGroup</a></li>

</ol>

  </div><!--/.sidebar-offcanvas-->

  <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    flutter_contacts
      1.1.7+1
  </span>

  
</footer>



<script src="../../static-assets/highlight.pack.js?v1"></script>
<script src="../../static-assets/docs.dart.js"></script>



</body>

</html>

